<template>
	<view style="">
		<view class="px-3">
			<!-- 账单标题价格状态 -->
			<view class="flex align-center mt-5 flex-column">
				<view class="font-md text-primary" v-if="detail.type==1">
					{{detail.serviceName}}
				</view>
				<view class="font-md text-primary" v-else>
					{{status()}}
				</view>
				<view class="font-md text-primary py-2">
					<text>{{detail.type==1? '+':'￥'}} </text>
					{{detail.price}}
				</view>
			</view>

			<!-- 详情 -->
			<view class="mt-6">
				<view class=" py-2 text-primary flex mb-4">
					<view class="list">账单类型:</view>
					<view v-if="detail.type==1">收入</view>
					<view v-if="detail.type==2">提现</view>
				</view>
				<view class=" py-2 text-primary flex  mb-4">
					<view class="list">账单余额:</view>
					<view>{{detail.amount}}</view>
				</view>
				<view class="" v-if="detail.type==1">
					<view class=" py-2 text-primary flex  mb-4">
						<view class="list">订单时间:</view>
						<view>{{detail.createdAt}}</view>
					</view>
					<view class=" py-2 text-primary flex  mb-4">
						<view class="list">订单编号:</view>
						<view>{{detail.number}}</view>
					</view>
				</view>
				<view class="" v-else>
					<view class=" py-2 text-primary flex  mb-4">
						<view class="list">创建时间</view>
						<view>{{detail.createdAt}}</view>
					</view>
					<view class=" py-2 text-primary flex  mb-4">
						<view class="list">提现账户</view>
						<view>{{detail.payeeAccount}}</view>
					</view>
					<view class=" py-2 text-primary flex  mb-4">
						<view class="list">提现方式</view>
						<view>支付宝</view>
					</view>
				</view>
				<view class=" py-2 text-primary flex  mb-4">
					<view class="list">交易编号:</view>
					<view>{{detail.dealNumber}}</view>
				</view>
			</view>

			<!-- 提现问题找客服帮助 -->
			<view class="mt-5 flex align-center justify-center" v-if="detail.status==3">
				<text class="text-secondary">提现有问题?</text>
				<text class="main-text-color ml-1" @click="moble">客服帮助</text>
				<text class=" text-light"></text>
			</view>
		</view>
	</view>
</template>

<script>
	// import freeNavBar from '@/components/common/nav-bar/free-nav-bar.vue';
	import {
		requestAndroid
	} from '@/common/js/location.js'
	import {
		selectOneWalletRecords
	} from '@/apis/wallet/index.js'
	export default {
		data() {
			return {
				detail: {},
				id: '',
			}
		},
		components: {
			// freeNavBar
		},
		onLoad(option) {
			this.id = option.id
		},
		onShow() {
			this.get()
		},
		computed: {

		},
		methods: {
			async get() {
				let id = this.id
				let res = await selectOneWalletRecords({
					id
				})
				if (res.success) {
					this.detail = res.object
				}
				console.log(this.detail, '详情')
			},
			//客服
			moble() {
				// this.$store.dispatch('call')
				requestAndroid('android.permission.CALL_PHONE', '通话权限')
				uni.makePhoneCall({
					phoneNumber: '4008809120',
					fail() {}
				})
			},
			//提现状态
			status() {
				if (this.detail.status == 1) {
					return '提现中'
				} else if (this.detail.status == 2) {
					return '提现成功'
				} else if (this.detail.status == 3) {
					return '提现失败'
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.list {
		width: 140rpx;
		height: 42rpx;
	}
</style>
>>>>>>> fada28f7e0b3a25a7b06d7be22bf0e8df22d80aa